package com.glsc.ngateway.flowable.config;

import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.spring.boot.EngineConfigurationConfigurer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.PlatformTransactionManager;

import javax.annotation.Resource;
import javax.sql.DataSource;

/**
 * desc: flowable配置----为放置生成的流程图中中文乱码
 */
@Configuration
public class FlowableConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {

    private static Logger logger = LoggerFactory.getLogger(FlowableConfig.class);

    @Resource(name = "datasourceMysql")
    private DataSource dataSource;
    @Resource(name = "transactionManagerMysql")
    private PlatformTransactionManager transactionManagerMysql;


    @Override
    public void configure(SpringProcessEngineConfiguration engineConfiguration) {
        engineConfiguration.setActivityFontName("宋体");
        engineConfiguration.setLabelFontName("宋体");
        engineConfiguration.setAnnotationFontName("宋体");
//        engineConfiguration.setAsyncExecutor(engineConfiguration.getAsyncExecutor());
//        engineConfiguration.setDataSource(dataSource);
//        engineConfiguration.setTransactionManager(transactionManagerMysql);
    }
}